Skip to content

Add realm operations API to BoxelCLIClient#4423

Draft
jurgenwerk wants to merge 5 commits intomainfrom
cs-10642-boxel-cli-realm-operations-api
Draft

Add realm operations API to BoxelCLIClient#4423
jurgenwerk wants to merge 5 commits intomainfrom
cs-10642-boxel-cli-realm-operations-api

Conversation

@jurgenwerk
Copy link
Copy Markdown
Contributor

Summary

  • Add read(), write(), delete(), search(), listFiles() methods to BoxelCLIClient
  • Each method uses the profile manager's authedRealmFetch() for auth (automatic token lookup, 401 retry, refresh) — callers never touch tokens
  • Phase 1 of migrating the factory off manual token management (CS-10642)

Builds on #4422 (pullRealmFiles replacement).

Test plan

  • boxel-cli type checks clean
  • All 360 software-factory node tests pass
  • Phase 2: swap factory callers to use these methods

🤖 Generated with Claude Code

jurgenwerk and others added 2 commits April 16, 2026 13:39
Add a programmatic pull() method to BoxelCLIClient that reuses the
existing RealmPuller (auth via active profile, concurrent downloads,
checkpoints) and returns { files, error? } instead of calling
process.exit().

Replace the 90-line HTTP implementation of pullRealmFiles in
realm-operations.ts with a 3-line delegation to the new client method.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Expose realm file operations as methods on BoxelCLIClient. Each method
uses the profile manager's authedRealmFetch for auth (automatic token
lookup, 401 retry, token refresh) so callers never touch tokens directly.

This is Phase 1 of migrating the factory off manual token management —
the methods exist now, Phase 2 will swap factory callers to use them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jurgenwerk jurgenwerk changed the title CS-10642: Add realm operations API to BoxelCLIClient Add realm operations API to BoxelCLIClient Apr 16, 2026
…rations

Replace explicit RealmFetchOptions (authorization + fetch) threading
with BoxelCLIClient methods throughout the software-factory package.
Auth is now fully owned by the boxel-cli profile manager.

Key changes:
- ToolBuilderConfig.realmTokens replaced with client: BoxelCLIClient
- All factory tools use client.read/write/search instead of realm-operations
- RealmIssueStore, RealmIssueRelationshipLoader, factory-seed, lint-result-cards,
  test-run-cards all accept client instead of RealmFetchOptions
- Added getRealmToken() to BoxelCLIClient for Playwright token injection
- Removed buildFetchOptions/resolveAuthForUrl from factory-tool-builder

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
}
}

export async function pull(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can drop the pullCommand function and use this function in registerPullCommand and move the console.log and process.exit that previously handled in pullCommand to registerPullCommand.

jurgenwerk and others added 2 commits April 16, 2026 15:51
Add runCommand, lint, waitForFile, waitForReady, authedServerFetch
to BoxelCLIClient. Remove authorization from CreateRealmResult,
ToolBuilderConfig, ToolExecutorConfig, IssueLoopWiringConfig,
ValidationPipelineConfig, SeedIssueOptions, and all validator configs.

The factory no longer threads raw JWT tokens — BoxelCLIClient handles
all auth via the profile manager's authedRealmFetch/authedRealmServerFetch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…unCommand through authed fetch

The mock client had stubs returning canned responses for lint(),
listFiles(), and runCommand(). These need to delegate through the
injected fetch (which has auth headers) for e2e tests against the
live realm server.

Also fix lint-validation.spec.ts to pass authed fetch to mock client
instead of bare globalThis.fetch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants